package com.hxkj.dao.impl;

import com.hxkj.dao.ManuscriptDao;
import com.hxkj.domain.po.*;
import com.hxkj.mapper.ManuscriptMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-06-05 19:32:55
*
*/
@Service("manuscriptDao")
public class ManuscriptDaoImpl implements ManuscriptDao {

    @Resource
    private ManuscriptMapper manuscriptMapper;

    @Override
    public Manuscript get(Long manuscriptId) {
        return manuscriptMapper.selectByPrimaryKey(manuscriptId);
    }

    @Override
    public List<Manuscript> get(Manuscript manuscript) {
        return manuscriptMapper.select(manuscript);
    }

    @Override
    public int delete(Long manuscriptId) {
        return manuscriptMapper.deleteByPrimaryKey(manuscriptId);
    }

    @Override
    public int delete(Manuscript manuscript) {
        return manuscriptMapper.delete(manuscript);
    }

    @Override
    public int save(Manuscript manuscript) {
        return manuscriptMapper.insert(manuscript);
    }

    @Override
    public int update(Manuscript manuscript) {
        return manuscriptMapper.update(manuscript);
    }

    public Integer getMaxSeqNum(){
        return manuscriptMapper.getMaxSeqNum();
    }

    @Override
    public Manuscript getManuscript(Manuscript manuscript) {
        return manuscriptMapper.getManuscript(manuscript);
    }

    @Override
    public List<Manuscript> getManuscriptList(Manuscript manuscript) {
        return manuscriptMapper.getManuscriptList(manuscript);
    }

    @Override
    public List<Article> getPreCreateArticle(Map<String, Object> map) {
        return manuscriptMapper.getPreCreateArticle(map);
    }

    @Override
    public List<Channel> getPreCreateChannel(Map<String, Object> map) {
        return manuscriptMapper.getPreCreateChannel(map);
    }

    @Override
    public List<Column> getPreCreateColumn(Map<String, Object> map) {
        return manuscriptMapper.getPreCreateColumn(map);
    }

    @Override
    public SiteUniversal getSiteUniversal(Long siteId){
        return manuscriptMapper.getSiteUniversal(siteId);
    }
}
